local sk__youxia = fk.CreateSkill {

  name = "sk__youxia",

  tags = {},

}



sk__youxia:addEffect("active", {
  name = "sk__youxia",
  anim_type = "control",
  card_num = 0,
  min_target_num = 1,
  max_target_num = 2,
  prompt = "#sk__youxia",
  can_use = function(self, player)
    return player.faceup
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected, selected_cards)
    return #selected < 2 and not to_select:isNude() and to_select ~= player
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    player:turnOver()
    room:sortByAction(effect.tos)
    for _, id in ipairs(effect.tos) do
      local target = id
      if player.dead then return end
      if not target.dead and not target:isNude() then
        local card = room:askForCardChosen(player, target, "hej", sk__youxia.name, "#sk__youxia-prey::" .. id.id)
        room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonPrey, sk__youxia.name, nil, false, player)
      end
    end
  end,
})

sk__youxia:addEffect("prohibit", {
  name = "#sk__youxia_prohibit",
  --sk__youxia,
  is_prohibited = function(self, from, to, card)
    if to:hasSkill(sk__youxia.name) and not to.faceup then
      return card.trueName == "slash" or card.trueName == "duel"
    end
  end,
})

return sk__youxia
